home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freaks Macintosh Archive
/
Freaks Macintosh Archive.bin
/
Freaks Macintosh Archives
/
Macintosh
/
Development & Resource Tools
/
MacsBug6.5.3.sit
/
MacsBug 6.5.3
/
Previous Version Changes
< prev
next >
Wrap
Text File
|
1996-02-22
|
105KB
|
2,055 lines
==========================================
MacsBug Release Notes and Bedtime Tales
An ongoing release history for MacsBug 6.5
by Jim Murphy and Dave Lyons
==========================================
• 6.5.3 - Released 2/9/96
POWERPC STACK CRAWL
-------------------
Two bugs were fixed in Mixed Mode “SC6” stack crawls. The stack crawl would always
terminate when it encountered a 68K to PowerPC switch frame. It would also terminate with
no output in the PowerPC to PowerPC case if the current routine’s frame hadn’t yet been
set up.
DISASSEMBLY
-----------
When MacsBug is entered because of a crash, it no longer tries to disassemble instructions
around the current PC if it is at an invalid address (odd, unmapped, etc.). This means
that if a program somehow jumps into hyperspace, MacsBug won’t eat itself alive with
another exception. Instead, it will display a helpful message in the PC window area.
The “PlayMem” 512-byte scratch area will now disassemble with a name and offsets.
The ‘…’ character (Option-;) is now a shortcut for the address in the comment field at the
current PC. This is most useful when you want to disassemble at the target of a branch at
the current PC. With this shortcut, you no longer have to type the actual address.
The “IL”, “IP”, and “ID” commands support a ‘-c’ parameter, which means “current ISA”. For
example, “il -c …” (where ‘…’ means branch target effective address) disassembles using
the correct disassembler automatically. This feature is best used inside of a macro, and
the new standard macro “IT” takes advantage of it (see the Macro section below).
POWERPC DISASSEMBLY
-------------------
Fixed a bug in the PowerPC disassembler front-end logic which would only let you
disassemble code at addresses after the system heap start and below the last byte of
contiguous RAM (not logically remapped memory), in PowerPC file mapped space, or in the
ROM. Any other location would get you an “unable to access that address” message.
Rolled in the latest version of the disassembler. It’s a little smaller, and it fixes a
problem where the extended mnemonic “mr.” was incorrectly disassembled as “mr”.
The disassembler now calls the full symbol lookup code when performing effective address
replacement. This fixes two problems; 1) bls to C++ functions now shows the unmangled
name, 2) bls to functions not owned by CFM which contain traceback symbols will correctly
find and use the names.
68K DISASSEMBLY
---------------
In 68K disassembly, MacsBug no longer says “will set to ones” for the $50FF instruction
(it’s an illegal 68K instruction). Added “will trap” and “will not trap” for the various
trap instructions.
POWERPC EXCEPTIONS
------------------
Taking a PowerPC exception no longer trashes the 68K registers D0, A0 and A1. This meant
that as you stepped PowerPC code, some 68K registers were silently changing.
MacsBug now tries to protect itself from installing its PowerPC exception handler twice.
This fixes the problem on certain Performa 5200/6200 configurations where you couldn’t
set breakpoints or step in PowerPC code.
SYMBOL LOOKUP
-------------
Sped up the PowerPC and 68K embedded symbol lookup when using the Command-: pop-up and
when evaluating any name in an expression.
Significantly reworked the embedded symbol lookup code to better deal with areas of code
that are PowerPC, but aren’t known by CFM (such as accelerated resources). In the past, if
code wasn’t known by CFM, it was assumed to be 68K, and the PowerPC traceback code was
never given a chance to find symbols. That could give very misleading information since
quite often parts of PowerPC tracebacks look like old fixed-length 8-character MacsBug
names.
Reduced the character space for valid traceback symbols to match embedded 68K symbols.
This should remove a number of invalid symbols.
When showing what PowerPC fragment an address is within, we now show the byte offset into
the fragment. This helps when you’re in VM file mapped space and thus not in a heap block.
Rolled in the latest C++ symbol unmangler. It’s way cool, and attempts to make sense out
of the varying mangling schemes in the ARM, xlC, MrC, Symantec, and CFront. It does a very
good job, too.
Refreshing the scrollback area after the Command-: symbols pop-up is dismissed now
correctly accounts for a scrolled history buffer and doesn’t redraw the wrong text.
REGISTER EVALUATION
-------------------
I can’t believe this has been broken for so long (all previous versions of MacsBug 6.5).
When running with VM on, the value to which “SP” and “A7” evaluate was the interrupt stack
pointer, which is wrong. They now correctly evaluate to the value displayed in the regster
area for A7.
All 68K Dn and An registers are now valid when in PowerPC code. This means you can now
display and change them, regardless of the current instruction set. I could go on about
how this took some serious voodoo magic, but it didn’t.
BREAKPOINTS
-----------
Added support for a low-level PowerPC Debugger trap that will stop on the instruction
after the trap, without modifying any registers. This is useful for stopping in arbitrary
locations within hand-written assembly code. With this special trap, you don’t have to
make a cross-TOC call to the high-level Debugger implementation which destroys the
volatile registers. The trap instruction is:
#define kPowerPCLowLevelDebuggerTrap 0x7F800008 // tw LT|GT|EQ,r0,r0
This trap instruction behaves much like the high-level Debugger call in that it can be
enabled and disabled with the “DX” (Debugger Exchange) command.
The “BRM” command (Breakpoint Multiple) works again for the first time in years. It was
broken in the first version of MacsBug 6.5.
STEPPING
--------
Fixed a bug in the mode switching step logic. If you stepped across a PowerPC to 68K
boundary with a step count or expression (ie. Step until PC = blah), the 68K code on the
other side was disassembled as PowerPC. The instruction set associated with the current
PC, which is passed into the disassembler, was synchronized only when a 68K to PowerPC
switch occurred.
After a step, we now show things of interest that may have changed. Currently MemErr,
ResErr, and QDErr are watched. If there’s anything else cool we should watch, let us know.
Here’s a sample line of output when the value of ResErr changed when a Step Over was
executed:
Step (over)
'CODE 0002 08D2'
+0274C 00CCFDBC _GetResource ; 00049BAE | A9A0
••• ResErr changed to #-192 (from #0)
For drivers that like to call the Memory Manager, we need to save and restore MemErr
around all of the video driver calls in the step code path. This means MemErr won’t get
reset to zero as you step.
A-TRAP ACTIONS
--------------
Fixed A-Trap actions when tracing over a trap to actually work again. For example, if you
break on MountVol, and then set an ATB on Read, and then trace over the MountVol, you
won’t break on Read even though it’s being called a number of times. This was broken in
MacsBug 6.5.2 in an attempt to fix anther bug. Both are now fixed.
A-Trap disassembly and breaking has been significantly enhanced to support all variants of
each trap word. For example, we now correctly disassemble the trap word 0xA22E as
BlockMoveData, and you can now break on it by name. We’d suggest using the new API command
to browse the full namespace that MacsBug supports for trap display and breaking.
Updated trap selectors for DisplayDispatch, ColorSync 2.0, HFSUtil, FSM, ReleaseFolder,
QuickTime and SoundDispatch.
API COMMAND
-----------
Added a new command, “API”. This command shows anything MacsBug knows about a given trap
or trap range. It shows if the trap has selectors, what those selectors are, and if they
are implemented in 68K code, PowerPC, or both. It’s way cool, and will show even more info
in the future.
HEAP DUMPING
------------
The “HD” command (Heap Dump) has new options that can greatly reduce the number of heap
blocks you need to examine during debugging. The ‘-s’ and ‘-e’ options allow you to
constrain the range of addresses that are dumped within the current heap. The ‘-s’ option
lets you specify the starting address, and ‘-e’ lets you specify the ending address.
If you use the two options together, ‘-e’ can optionally be used as a byte count. If the
end is less than the start, it’s a length.
To limit display to blocks of certain sizes, you can use up to two options of the form
“,<20”. The possible tests are <, =, >, <=, and >=. For example, “HD RS,>1K,<5K” shows
resource blocks with sizes between 1K and 5K.
COMMAND LINE
------------
The macro “GG” (clear breaks and Go) no longer gets saved into the command-line history.
Made the command line history logic sensitive to case. This is useful such as when you
capitalize a case-sensitive CFM symbol incorrectly and then repeat the command. The
corrected version now gets saved in the command history.
Parameter parsing works much better, because binary ‘-’ (subtraction, not negation) can no
longer have a blank before it. This means that commands such as “RD -f 2 -i 3” now work,
for example. Previously, it would try to evaluate “2-i”.
MACSBUG PREFERENCES FOLDER
--------------------------
The “MacsBug Preferences” folder can now be located in the same folder as MacsBug (the
System Folder) or within your “Preferences” folder (actually whatever it’s called, we’re
international-savvy). You can place your various preferences files within either or both
of these folders. As before, up to 32 files will be opened (this is the sum total of both
folders, not 32 per folder).
DCMDS
-----
The PC window now redraws if a dcmd modifies the current PC.
Updated the Errors dcmd to match the latest Errors.h header file. I also rewrote it in C
because I was bored one night (yes, that bored).
Fixed two problems in the Leaks dcmd which could cause it to crash on 68K machines. It now
does Mixed Mode stack crawls only if it’s on a PowerPC machine. The PowerPC crawl now
validates the back chains as it climbs over switch frames. Updated the display of ISAs to
be more consistent with MacsBug.
The Gestalt dcmd has been enhanced, and now takes two options. It can be asked to just
show one selector as in “Gestalt 'sysa'”, and it can just dump the installed selectors
without calling them as in “Gestalt -n”.
The RD dcmd has a new option, ‘-o’, which turns on display of resource data offsets.
Some labels have been abbreviated to save space.
The functionality of the StopIf dcmd is now part of MacsBug as a built-in command. The
external implementation was quite lame in that it poked MacsBug’s globals (incorrectly,
for the last couple of years).
Fixed a problem where the A7 register as passed to dcmds with VM on is the wrong stack. It
was always passing the interrupt stack pointer, when it really should be the one shown in
the register display area as A7.
Universalitized dcmd.h and dcmd.p. All constants are now enums, rather than #defines. The
input strings to callbacks that are constant are now declared properly. The files are now
wrapped in the standard C++ and structure alignment goo.
Added the FSInfo dcmd (by Jim Luther), and made it format 3. It has a new option, ‘-t’,
which shows a summary table of all installed external file systems.
When warning that you have duplicate dcmds, the compare is now case-insensitive, so we
don’t miss any.
Updated all of the sample dcmds sample build commands to be current.
Included the latest PowerPC dcmds in their own file, “PowerPC dcmds”.
MACROS
------
Added MPW SetKey-style key bindings for all extended keyboard function keys. You can
define macros that get executed when any of the keys are hit. The macros expected are of
the following form (where ‘n’ is the function key from 1 through 15):
DoFn
DoCmdFn
DoOptFn
DoCmdOptFn
The extended keyboard keys Help, Home, Page Up, Forward-Delete, End, and Page Down are now
supported. With Help you can type a command name and then Help, and you’ll get that
specific reference section. Help alone gives you the entire help text (pressing Help
places a ‘?’ as the first character on the command line and then presses return for you).
Added “cw” and “cwp” macros for breaking into the Metrowerks debugger in 68K and PowerPC
code, respectively.
The size of the buffer in which you can create macros at runtime has been increased from
256 bytes to 1K.
The “MC” command (Macro) now wraps output properly, rather than having it extend off of
the right side of the screen.
Added comments to some common macros, which are now shown if you get help on a macro.
Added a macro named “IT” which disassembles the target effective address at the current
PC. This is a shortcut for typying “ILP …” or “IL …” (the macro does the right thing and
gets the instruction set correct).
Added a “TimeTasks” macro for walking though all of the currently pending Time Manager
tasks.
TEMPLATES
---------
Added some new basic types: SECONDS, ATRAPWORD, BINARY8, BINARY16, BINARY32, and OSTYPE.
A number of the standard templates were changed to use these new types.
The CGrafPort template now references the portPixMap as a PixMap, rather than a handle.
The IOREFNUM basic type now displays driver names as well as file names.
Duplicate definitions of DCtlEntry and Driver were removed from the standard templates.
LOGGING/STDLOG
--------------
MacsBug now knows what version of the system it’s running on when you break into it right
after it loads. This means log files at boot time will go to the desktop by default (among
other internal behaviour changes).
The log mechanism has been enhanced to be as robust as it can be, given the runtime
MacsBug lives in. We now make sure interrupts are enabled when both printing and logging.
We no longer write data to the log file when the file system is busy (as best as we can
tell), and you’ll get a warning message if it is. This should clean up a lot of lockups
if you NMI with logging on. Writes to the log no longer go into the file system cache.
When writing to the log file, we now flush the volume as well as the file. This way all
logging actions should stick even if you crash with the file still open.
The “StdLog” macro (and any others that use the SET SUSPENDPROMPT feature) no longer
randomly starts prompting you to press return again after a dcmd executes.
Fixed the “StdLog” macro so it doesn’t change your current TargetZone (the calls to “HX”
are now balanced).
The “STAT” command now displays the Gestalt ‘sysu’ (System Update version) value if it’s
present.
MISCELLANEOUS
-------------
Help on the Help command works reliably now.
Added a new SET option, “SIMPLIFIED”. This allows you to toggle the display of PowerPC
extended mnemonics.
If MacsBug is running on a PowerPC machine, it now ignores what Gestalt says and records
that the ROM is really 4 MB. This means that using the “WH” command (Where) in the last
1 MB of the ROM will say it’s in ROM, because it really is. Previous versions of MacsBug
thought ROMs on PowerPC machines were 3 MB (that’s the size of the 68K portion).
The U.S. KCHR that we distrbute is now the System 7.x one instead of 6.x.
A command of “# ” (pound sign followed by a blank) means the rest of the line is a
comment. This is useful in macros.
If we have a ‘#’ in front of a decimal constant and fail to convert it, that’s an
immediate syntax error. We no longer incorrectly proceed to look it up as a symbol.
The machine names list had an incorrect ‘mach’ value for the 8100/100.
Blank Return just scrolls display by one line, so you can now insert blank lines into the
history if you wish.
The internal processor cache range flush routine now goes to extra efforts to make sure
that the cache flushing A-Trap it calls is implemented before calling it. This makes “SM”
(Set Memory) and breakpoints work at boot on older Mac IIs.
The 6100/7100/8100 sound driver bus error fix now only runs on 7.5, 7.5.1, and 7.5.2. The
real bug has been fixed in System 7.5.3.
The “CS” command (Checksum) now shows the checksum value. The trivially simple 68K
assembly code to do the checksum is:
*****************************************************************************************
;
; pascal long ComputeChecksum(Ptr lowAddr, Ptr highAddr);
;
; Calculate checksum over specified address range. Checksum is calculated by summing
; one byte at a time into a long word starting from the low address, and rotating
; left 1 bit (high order bit rotates to low order bit) after each byte is added.
;
ComputeChecksum FUNC EXPORT
move.l (sp)+, d0 ; Return address
movea.l (sp)+, a1 ; High address
movea.l (sp)+, a0 ; Low address
move.l d0, -(sp) ; Restore return address to stack.
moveq #0, d0
; Sum bytes in long word, rotating left one bit after each byte is added.
@loop add.b (a0)+, d0
rol.l #1, d0
cmpa.l a1, a0
ble.s @loop
move.l d0, 4(sp)
rts
ENDF
• 6.5.2 - Released 7/26/95
| •• NOTE •• - MacsBug 6.5.1 was never released, so please be sure to read what changed in
| •• NOTE •• - that version in the section below.
MIXED MODE STEPPING
-------------------
You can now step across all Mixed Mode transitions. This means that when you come up to a
MixedModeMagic trap, stepping once more lands on the first instruction on the other side,
whether it's 68K or PowerPC. Similarly, when you're stepping through PowerPC code that
calls the functions CallUniversalProc or CallOSTrapUniversalProc, you will automatically
land on the other side of the call. When returning from a 68K routine to PowerPC code or
vice-versa, stepping the return instruction will take you back to the caller, whether it's
68K or PowerPC. There should be no instances where stepping takes you into Mixed Mode itself
(so if you're debugging Mixed Mode, use another debugger).
Mixed Mode stepping works equally well with accelerated ("fat") resources. If your 68K code
loads and calls into a fat resource, you can simply step right into it.
NMIs IN NATIVE CODE
-------------------
Using the NMI key sequence, you can now interrupt native code execution, and will land on the
PowerPC instruction you interrupted. However, due to reentracy concerns, you cannot interrupt
in the middle of Mixed Mode execution, you'll land in 68K code like you used to do with older
versions of MacsBug.
BUS ERROR CATCHING ON POWERPC
-----------------------------
Bus error handling on the first-generation PowerPC machines (6100/7100/8100) now works. This
really wasn't a bug in MacsBug, but I fixed it anyway. The problem was that the sound-in
component trashes the bus error vector when it is loaded (this is the case in 7.5 and 7.5.1).
MacsBug now takes care of the component load through a magical patch, and fixes up the bus
error vector if it becomes damaged. See, MacsBug really is system software.
POWERPC STACK CRAWL
-------------------
Fixed the infinite loop bug in the “SC” command when walking back over PowerPC->68K switch
frames (mentioned in the 6.5.1 release notes).
POWERPC DEBUGGER/DEBUGSTR CALLS
-------------------------------
When you execute a Debugger or DebugStr in native code, you should no longer land in the
implementation (in InterfaceLib at present), you'll be in your own code right after the branch
to the library where they live.
POWERPC STEPPING
----------------
Stepping or tracing with a count now works in PowerPC code.
POWERPC REGISTER DISPLAY
------------------------
When on a PowerPC machine, we now show the current interrupt mask in place of the Memory
Manager mode in the left sidebar area (you're always in 32-bit mode). This is shown (and is
correct) when in both 68K or PowerPC code.
The current interrupt mask is shown in the PowerPC register set when the “TD” command is used.
Changed “TF” command to show the exponent and sign of each FPR as one component.
REGISTER ASSIGNMENT
-------------------
You can now set and get A5 when in both 68K and PowerPC code. For the moment, this is the only
68K register you can get to since it's the most useful. This means that macros like “thecport”
work regardless of the current instruction set.
The 68020-040 register formerly known as “DFC” (Data Function Code) must now be called “RDFC”
so it's no longer hex (nobody cares about this register anyway).
COMMANDS FIXED/ADDED
--------------------
Added a new command "STAT" and incorporated it into the StdLog macro. It shows lots of useful
information you can see on the screen, but have never had an easy way of getting into the log
(at least not very concisely). For instance, it identifies the names of all shipping machines
that have unique box flag values, shows used stack space, max-used stack space when available,
and ResErr/MemErr when they are nonzero.
The “EA” (Exit to Application) and “ES” (Exit to Shell) commands now work when you're in PowerPC
code.
The “IR” (Instruction list to Return) command now works in PowerPC code with no address.
“IRP” (Instruction list to Return PowerPC) command has been added.
“GTP” (Go Till in PowerPC code) command has been added.
Restarting (RS/RB) now works in a general way on PCI-based machines. It used to need a box flag
table, which was a work-around for early developmental ROMs without a reasonable Gestalt selector
to identify that the machine needed a hard reset to restart.
The “DMA” (Display Memory ASCII) command now honors the DITTO mode.
WH COMMAND
----------
When displaying the CFM library an address lives in, we now display the executable and writable
status of the section the address is in (if any).
If an address is in low memory, we now say so (instead of saying it's in RAM but not in a know heap).
A-TRAP RECORDING ON QUADRA/PERFORMA 63x AND POWERBOOK 150
---------------------------------------------------------
It works, and doesn't make your machine crash. I really don't want to tell you why 'cause it
would make a great puzzle page.
A-TRAP ACTIONS
--------------
A-Trap tracing and recording no longer mask trap values into the A000-A0FF and A800-ABFF range
when displaying them, all bits are shown as-is when the trap was executed.
A-Trap trace now shows the name of the real call that was made if the trap is selector-based
(dispatched), rather than the trap. This means you'll see traces with information such as
“SameProcess” instead of “OSDispatch”, which is much more useful.
A-Trap recording and tracing now identifies Enqueue and Dequeue as stack-based traps rather
than register-based (they aren't).
A-Trap break, trace, and step-spy logic has been fixed so you can now have combinations of them
pending at the same time that actually work. In the past you couldn't have a trace and a break
work at the same time, the first one that was activated got precedence. This means you can now
have multiple trace ranges and they'll work as well.
Fixed the long-standing (since November 24, 1992, to be exact) bug where you'd land near a TRAP #$D
inside MacsBug if you stepped over an A-Trap that had a break action set on it.
Setting an A-Trap break while in PowerPC code works (I was stupid and failed to install the
A-Trap dispatcher patch).
68K DISASSEMBLY
---------------
When disassembling a MixedModeMagic trap (0xAAFE) that's at the current 68K PC, we now show the
address that you'll land if you step across the mode transition, as well as the destination
instruction set.
When disassembling an A-Trap instruction, the comment field now contains the implementation
address of the trap, rather then the trap word. It's already shown off to the right anyway.
POWERPC DISASSEMBLY
-------------------
When disassembling PowerPC code that uses an offset off of R0, we now look up macros for that
address. For example, instead of getting this disassembly:
lwz r3, 0x064F(0)
you'll get:
lwz r3, JFlushCache(r0)
Throughout PowerPC disassembly all fields are now shown in hex instead of decimal.
The symbol lookup code now lets tracebacks win if they're at the same address as a previously
found CFM export. This lets the disassembler munch the embedded data making the disassembly look
nicer (and smaller).
The glue sniffer can now identify Microsoft-style cross-TOC glue.
SYMBOL LOOKUP
-------------
I drastically sped up CFM/traceback lookups over 6.5.1 so MacsBug is usable again.
Optimized embedded 68K symbol lookup so it's about 10% faster.
MISCELLANEOUS
-------------
Fixed all instances (hopefully) where switching ISAs while in MacsBug wouldn't cause the register
names to be erased and redrawn. My internal concept of current and previous ISA was a bit loopy.
The syntax error display for all non-repeating commands has been fixed (br, etc.) You'll no longer
see the entire help text as one garbled mess. Yeah, it confused me too.
The “explain significance of” feature shows nicer output for slightly-negative numbers (0 to -16M).
The display of “is a bad pointer” only yells about odd pointers on 68000s.
Made internal commands override dcmds of the same name. You can specify a dcmd (only) by putting
a "∂" in front of the name (and it should work for Help, too, as in "?∂cfm").
Allow "≠" for not-equal (Dave did it, I'll never remember it).
Moved the typographical quotes up by one pixel (to make Greg Robbins happy).
BUILT-IN DEBUGGER PREFS
-----------------------
Fixed Get1xType and Get1xResource to be Get1IndType and Get1IndResource (we've added two macros
to let you still type Get1xType and Get1xResource if you really want to).
Replaced PPCJump macro with a more general one. PPCJumpA is now the old "branch absolute"
version.
• 6.5.1 - Built 6/2/95 - never released due to serious symbol lookup bug
POWERPC SYMBOL LOOKUP
---------------------
The PowerPC symbol lookup mechanism has been reworked so that exported CFM symbols and
embedded traceback symbols get along much better. If you have a PowerPC container that
has both exports and tracebacks, CFM symbols no longer always win, the best (closest) symbol
of either type will be returned.
When disassembling arbitrary PowerPC code (you know, when you're bored and still at work at
4:00 am), MacsBug now sniffs through cross-TOC glue code to provide meaningful symbols. So,
instead of seeing something like this:
bl $+0x76F8 ; 0x00007848 | 480076F9
lwz RTOC,0x0014(SP) | 80410014
You'll see something like this:
bl NewPtrSysClear ; 0x00007848 | 480076F9
lwz RTOC,0x0014(SP) | 80410014
Currently this works with applications and any import libraries that are pulled in by CFM as part
of a closure, such as InterfaceLib, MathLib, or DragLib, for example. If you load and prepare
a fragment yourself, or use accelerated resources, MacsBug cannot identify the symbols in those
fragments. However, this may change in the future.
EMBEDDED SYMBOLS
----------------
When walking a heap to search for embedded symbols, either by name or address, the code that
determined whether a heap block should be searched was rather lame. It rejected all non-relocatable
blocks, but was quite happy to search free blocks. This meant it wasted a lot time looking for
symbols where you wouldn't have any, and it probably missed others that you did have. One
place where you'll notice this is when you “HX” to the System heap and use symbols pop-up window.
You'll probably see lots of new names that have been lurking in non-relocatable blocks.
Please note that if you evaluate a symbol in the System heap (by typing its name on the command-
line), the time to search can take significantly longer than in previous versions. This is simply
due to searching more blocks. In future versions the performance will be addressed.
POWERPC EMBEDDED SYMBOLS
------------------------
You can now use the names of traceback symbols in expressions just as you have been able to
with embedded 68K MacsBug names for, well, ever. As with 68K names, only the TargetZone as
specified with the “HX” command will be searched.
SYMBOLS POP-UP WINDOW
---------------------
The utility and size of the symbols pop-up window has been increased. The width is now relative
to the width of the MacsBug display area, so it's larger. This should provide a bit more room
for really long unmangled C++ symbols.
MacsBug now locates and displays more types of symbols in the pop-up. It can now find 68K
embedded symbols, PowerPC traceback embedded symbols, and CFM code exports. Each symbol is now
classified with a symbol/instruction set designator at the right side of each line displayed.
The symbol types you should see, as well as their meanings, are as follows:
68K MBug - Traditional 68K MacsBug embedded symbol
PPC TBT - PowerPC/AIX-style traceback table embedded symbol
PPC CFM - PowerPC Code Fragment Manager exported TVector symbol
POWERPC DEBUGGING
-----------------
A number of bugs involving PowerPC debugging have been fixed. These are:
• You can now hit a breakpoint and Go from it. Previously, you had to step once before
allowing execution to continue or you'd crash.
• You can now step over a subroutine call such as “bl” when it has a breakpoint set on it.
• When stepping over a conditional subroutine call such as “beqlr” when the branch is not
going to be taken, MacsBug no longer returns to running your program at full-speed.
• Expressions and counts on breakpoints now actually work.
POWERPC EXCEPTION PROCESSING
----------------------------
Previous versions of MacsBug would handle more or less every exception that was passed to it.
In certain situation this is a reasonably unfriendly thing for it to be doing, and can really
annoy the user. So, in an effort to be nicer to users as well as high-level debuggers, MacsBug
now only catches exceptions if nobody else chose to do so. This means that all PowerPC unmapped
memory exceptions that take place within the Modern Memory Manager due to broken applications
will once again be masked from the user's view.
However, if you would prefer to be notified about every exception, there are two ways you can
re-enable previous behavior. At runtime, you can use the new “SET AUTOGP” command. When AUTOGP
is enabled (the default), all exceptions are automatically forwarded to anyone who wants them.
When it's off, MacsBug will catch everything that comes its way. If you would like to permanently
set the behaviour, you can edit the 'mxpr' resource within MacsBug using ResEdit. By setting the
“Don't auto propagate PowerPC xcpts” field, you can specify the initial AUTOGP value.
When you're executing PowerPC code and somehow get your PC pointing into unmapped memory, MacsBug
handles this a bit better. It used to take a 68K bus error in the middle of the PowerPC bus error,
and it would show the entirely wrong register set. It's not perfect (yet) but at least it will be
a lot less confusing if this ever happens to you.
HEAP ZONES
----------
Throughout MacsBug, application heaps are now called out with the name of their corresponding
application. Only the heap that an application was launched into is named, any other private
heaps that an application may have created are not named. Heap names are used in such places
as the “HX” (Heap Exchange), “HZ” (Heap Zones), “HT” (Heap Total), and “WH” (Where) commands,
among others.
The “HZ” command has been enhanced to display the size of each heap in K. The values are shown
on the left side of the display before the heap addresses.
HEAP CHECK COMMAND
------------------
The “HC” (Heap Check) command now has an option. Rather than just checking the TargetZone, you
can now check all heaps simultaneously with the “ALL” option. The set of heaps that is checked
is that same that are identified with the “HZ” command. If the command detects any of the heaps
to be corrupt, it will not terminate the overall check, it will continue on with the next heap
(if any).
HEAP CORRUPTION DETECTION
-------------------------
Whenever MacsBug walks a heap, either explicitly when you dump a heap, or implicitly when looking
up a symbol, each heap block is checked for possible corruption. However, due to a bug introduced
when it was rewritten in C, the three tests performed on each block all had to fail simultaneously
for a block to be marked as bad. Since two of the three were mutually-exclusive, MacsBug could never
detect any block as being bad. This strikes us as less than useful, so it's been fixed. Note that
this code was not part of the “HC” command, which worked fine, it's only a simple test within the
general heap walker mechanism.
STACK CRAWL
-----------
MacsBug now can walk A6/R1 Mixed Mode stacks with the “SC” command. Consistent with previous
behaviour, if it can't find a valid back-chain link, the crawl terminates. A very small number of
people have reported that the command occasionally never returns keyboard control. This may have
been due to other problems in embedded symbols lookup (which have been fixed and were noted above),
but since we could never reproduce the lockup, we're just not sure. If you have any problems with
this new feature, please let us know about it as soon as possible.
Occasionally, if you and/or your computer got hit with some wiggy particle from space aliens, the
SC7 command would abort with an “Unable to access that address” message when looking for valid
PowerPC return addresses. I got hit with a really gooey particle (knocked me unconscious, too) and
was lucky enough to get a reproducible case of this problem, so now it's fixed.
68K DEBUGSTR
------------
Due to a Ptr (generally signed char) vs. StringPtr (unsigned char) bug, the string that was passed
to DebugStr was limited to 127 characters. If the string was longer, nothing would be displayed.
This is no longer the case; DebugStr strings can now be up to 255 characters long.
When running in 24-bit mode on a 32-bit capable machine, if the pointer to the DebugStr string had
any bits set in the high byte, MacsBug could bus error when trying to display the string. This has
been fixed.
A-TRAP BREAKS
-------------
When VM was on, and you attempted to break on a selector-based trap whose selector value was
on the stack, we looked on the wrong stack for the value. Obviously, this greatly reduced the
chances that we'd actually break when you expected it to.
68K DISASSEMBLY
---------------
When disassembling a PACK A-Trap, we now display the name of the package in the comment field
of the disassembly.
MEMORY SETTING AND DISPLAY
--------------------------
When you use any of the Set Memory commands (“SM”, “SL”, etc.), the underlying processor cache
is now flushed over the range just set. This means you can now reliably modify code and then
execute it.
A new basic type has been added to those used in templates. IOREFNUM supports the display of
the file name associated with a given refNum, as well as the open fork ([data] or [rsrc]). For
example, if you use the “iopb” template, the output of the ioRefNum field used to look like this:
008C0E40 ioRefNum 0D98
but now looks like this:
008C0E40 ioRefNum 0D98 = MacsBug Release [data]
Changed the “DM” (Display Memory) command so that it uses ditto marks for groups of identical
lines when dittoing has been enabled with “SET DITTO ON”.
The “DMA” (Display Memory ASCII) command can now accept very large byte counts.
FILE DCMD
---------
The short-form display (file 0) now omits the fields which have no use after-the-fact in a
log file.
LEAKS DCMD
----------
The various Memory Manager patches are now installed at dcmdSecondaryInit time so that we
can detect leaks in PowerPC code (after the native Modern Memory Manager is loaded).
MISCELLANEOUS
-------------
MacsBug now knows how to hide the hardware cursor on machines that support it, such as the
PCI boxes.
The value of A7 shown by the “TD” (Total Display) command is now correct when running with VM
enabled. It used to be the value of the ISP, when it should have been the USP.
When any command reports a syntax error, a message is shown with the proper command syntax.
Added a new SET sub-option, “SUSPENDPROMPT”. This works much like the “SCROLLPROMPT” option,
but prompting is only disabled until the next line of command input is requested.
BUILT-IN DEBUGGER PREFS
-----------------------
The standard log macro (StdLog) has been enhanced somewhat. It now uses “HC” with the “ALL”
option, so it won't abort if a heap is corrupt. The macro now records the value of the long
at 0x00000000 so you can see if a piece of code was doing bad things.
Changed some templates to use the new basic type IORefNum, where appropriate.
Disk Init (PACK 2) actually takes its selector on the stack, not in D0. The glue moves it
through D0, which seems kind of lame, if you ask me (this means we won't disassemble this
without some special-case code which has yet to be written).
Added selectors for SpeechRecognitionDispatch, PowerMgrDispatch selectors $22..$28, and
ControlStripDispatch selectors new with Control Strip 1.2.
• 6.5d12 - Released 4/13/95
HEAP SCRAMBLING
---------------
When we move a block of data around, we can't tell if it contains executable code, so the
processor caches should have been flushed on the destination range. In the past, when
the entire cache was flushed very often, this wasn't a problem. With the cache flushing
changes in 6.5d10, heap scrambling became very much unreliable. This has been fixed.
POWERPC EMBEDDED SYMBOLS
------------------------
We now support looking up PowerPC embedded symbols from traceback tables. If you're using the
newest Metrowerks 1.2.1 C/C++ compilers you can take advantage of this. The only other compiler
I know that currently supports traceback tables is xlc for the RS/6000. With the current
implementation, typing a symbol name will not evaluate to the address of that routine. The
traceback symbols are currently only used within a disassembly of PowerPC code.
CFM SYMBOL LOOKUP
-----------------
When you're stepping through a fragment of PowerPC code that doesn't contain any exported
CFM symbols (a simple application comes to mind), the delay between steps has been drastically
reduced. This was done by removing a very large number of Mixed Mode switches on each line of
disassembly, as well as fixing a logic bug that caused us to exhaustively look for 68K symbols
when there couldn't possibly be any.
WH COMMAND
----------
When displaying an address that is in VM file-mapped space, MacsBug now shows what CFM library
the address resides within.
STACK CRAWL
-----------
MacsBug now understands Mixed Mode stacks when using the "SC7" command, and will show you
the instruction set of each caller. This command now works correctly from either PowerPC
or 68K code. For this release the "SC6" command works exactly as it did in 6.5d11 due to a
last-minute problem (infinite recursion sucks). It will fully understand Mixed Mode stacks
in the next release.
POWERPC DEBUGGING
-----------------
• When stepping up to a flow of control instruction, MacsBug displays a message which
indicates if the branch will or will not be taken. In previous versions this was
frequently wrong due to a sign-extension bug in the compiler, which we've worked around.
• You can now disable PowerPC Debugger and DebugStr calls with the “DX” command.
• The “TF” (Total Floating Point display) command now works when in PowerPC code, and will
show the entire PowerPC native FPU register set. You can now use “FPR0” through “FPR31”
in expressions, although this is totally useless since MacsBug's expression evaluation
is centered around 32-bit values, and FPRs are 64-bit.
• When displaying the PowerPC register set via “TD”, we now know about the 603e, and display
a reasonable message for future processors.
• When debugging PowerPC code at boot time, we no longer display the name of the currently
loading extension after each and every step or trace. My, that was annoying.
There are a few problems with native debugging that you should be aware of. They are:
• If you're stopped on a native breakpoint, you currently can't Go, you need to Step once
and then Go.
• As above, if you're sitting at a branch to subroutine instruction that has a breakpoint
located at it, you cannot Step Over the subroutine call without first removing the
breakpoint.
• If you use the single-machine Macintosh Debugger, or the Metrowerks Debugger which
require the PowerMac Debug Services background application, you shouldn't place the
app in the Startup Items folder. The app has a feature such that if it can't
communicate with a host debugger, it will DebugStr into 68K code when it sees a
native exception (breakpoint, trace, etc.). MacsBug will not get a chance to handle
any native exceptions. If you do use a high-level debugger in cooperation with
MacsBug, you should place the background application in the same folder as your
debugger so it gets launched when you start up the debugger.
RB AND RS
---------
These commands no longer reboot if there are extra parameters on the command line. The
motivation here is that Dave recently typed "rb -s" when he meant to type "rd -s", and
he really, really didn't mean to reboot his system at that particular time.
DCMD COMMAND
------------
We've added a new command which displays a compact list of all installed dcmds. This list
includes the dcmd name and syntax, as well as the version if the dcmd is format 3 or later.
The command can accept a optional prefix string to limit the display to a subset of all dcmds.
RD DCMD
-------
We've added a new option, "-h" which will show information on a resource given its handle.
Very, very useful. When looking up resources by type, the "-t" option is now optional, so
you can now type something like “RD 'STR '”.
GESTALT DCMD
------------
A number of new selectors were added to the list of those that are recognized.
THING DCMD
----------
The Thing dcmd is now a part of the standard MacsBug distribution. This dcmd displays
information on Components.
JUMPTABLE DCMD
--------------
Fixed a stack imbalance problem that would cause MacsBug to exit when the dcmd was done
executing. Why this had that sort of behavior and didn't crash is extremely odd.
EXPRESSION EVALUATION
---------------------
In the past there was no way to use the name of a trap in an expression and have it evaluate
to the trap's number. Using the syntax “††<trapname>” now provides for this. For example, if
you want to see what selector $18 off of trap HFSDispatch is, but you don't know the trap
number, this expression will do the trick:
dh 7018 ††HFSDispatch
Of course, in this example you had to know that 7018 was MOVEQ #$18, D0 (everyone does, right?).
With the addition of ROM map and Code Fragment Manager symbols in recent releases, the potential
for confusion about exactly what symbol will be found if a name collision occurs has increased.
If you know that a symbol you're trying to look up is ROM map-based, you've been able to prefix
the symbol with the Option-R ('®') character. Now you can do a similar lookup order force for CFM.
If your symbol string is prefixed with Option-G ('©'), it will be searched for first in the CFM
name space. Since Option-G looks reasonable when displayed ('C' == CFM), but is a pain to remember,
Option-C now maps to Option-G (try it, they're identical as far as MacsBug is concerned).
We've added a really cool new feature we call “explain significance of”. During simple expression
evaluation, we now show the magnitude of the resultant value in more human intelligible terms. In
our daily trials debugging the System Software, we're quite often surprised at how many people can't
look at a hex value and realize, “Oh, that's past the end of your logical RAM - that's why you died”.
With this feature we hope for a greater awareness of the general magnitude of things. For example,
typing the value $120C60 yields:
120C60 = $00120C60 #1182816 #1182816 '••`' (between 1M and 2M)
For values that contain lots of trailing zeros, you'll get to see a new notation we've developed
for more easily describing a 32-bit value. So that you don't have to call out each individual
trailing zero (and look silly counting along on your fingers as you talk to your co-workers), we've
developed the “kabillion” short-hand notation. For values that contain at least 5 trailing (least-
significant) zeros, the notation will be used. For example, for $40800000, you get:
40800000 = $40800000 #1082130432 #1082130432 '@A••' (just over 1G; 4 0 8 kabillion)
This is read “four-zero-eight kabillion” or “four-oh-eight kabillion”. Cool, huh?
You can now use the Option-/ character ('÷') as an alias for '/' (division).
MACROS
------
Macros can now optionally take parameters. When processing a macro expansion, positional
parameters ®1 through ®9 represent the remaining whitespace-delimited tokens on the command
line after the macro name. The parser understands the number of parameters your macro requires
by noticing the highest-numbered parameter. If you use ®9 as a single parameter, you must have
eight preceding parameters, which are ignored. These parameters can be quoted with single or
double quotes, the quotes are not part of the parameter value. For example, the following
macro takes a single parameter, a resource type. You would invoke this macro with a command
line such as “gres 'gpch'”.
"gres", "atb GetResource (sp+2)^='®1'"
A sample parameterized macro is provided within MacsBug which will break on all 68K calls to
GetResource, Get1Resource, and Get1xResource for a given type. This macro is named “RType”
and is invoked as in the example above.
When displaying macros with the “MCD” command, and the macro expansion needed two or more
lines to be fully displayed, the text really should have wrapped instead of disappearing into
the bit-bucket off the right side of the screen. Therefore, we now wrap the text appropriately.
If you terminate this command before it finishes, you'll now get control back a lot faster.
Since the evaluation of trap numbers in expressions has changed, if you want to find the
trap name given a number but don't want to have to type “WH ††Axyz”, we've added a simple macro.
The macro “WHT” shows the name and implementation address of a trap given a trap name or number.
TEMPLATES
---------
An extremely popular bug in template display has been fixed. When showing a region of memory
with a template that contained a pointer field, and that field was filled was a garbage bus-
error value, we'd quit showing the template when we reached that field. For example, doing
“dm a0 iopb” with an ioNamePtr field pointing off into unmapped space no longer terminates
the template display.
MODERN MEMORY MANAGER HEAP STUFF
--------------------------------
When identifying whether a heap is the Process Manager heap, we now only do this if the
Process Manager is around (ie. it's after boot time).
DISASSEMBLY
-----------
When displaying the offset into a procedure, we now show 5 nibbles for the offset instead of 4.
MISCELLANEOUS
-------------
If you've invoked a command that displays a lot of output, and tire of having to press Return
or Space to display another page, you can now temporarily turn off these prompts. Using Command-
Return or Command-Space at the prompt skips the remaining prompts this command would have generated.
You can still abort the command by pressing any key, you just won't be asked about it a bunch of
times. When the command terminates, the prompts will be re-enabled for the next command (unless
you've used the SET SCROLLPROMPT OFF to globally disable the feature).
When we switch instruction set displays, we should now properly clean up all extra pixels in
the register subdisplay.
When you execute a command with too many parameters, MacsBug now displays a much more useful
message, as well as actually showing you what parameters weren't needed.
Command-G, -S, and -T now only work if the command line is empty.
The TestDcmd application will now load format 3 dcmds, but doesn't do anything special to support
them.
The PlayMem general-purpose buffer is now always 4-byte aligned.
BUILT-IN DEBUGGER PREFS
-----------------------
We've added templates for the various SCSI Manager 4.3 API parameter blocks.
• 6.5d11 - Released 2/27/95
POWERPC DEBUGGING
-----------------
The support for PowerPC debugging has been greatly improved from that in 6.5d10, and
is now much more like debugging 68K code. The following enhancements have been made:
• MacsBug no longer handles all PowerPC trap or trace exceptions that are executed,
it only catches those that it specifically caused, or the special Debugger/DebugStr
trap. This fixes the popular incompatibility with the single-machine Power Mac
Debug Services application.
• The Debugger and DebugStr native traps are handled properly so that you won't
repeatedly hit the trap instruction. You can now step up to and over these
traps. Previously you had to manually set the PC past the trap to continue.
DebugStr now shows the passed in string just like the 68K _DebugStr.
• You can now trace over subroutine calls such as ‘bl’.
• When you step up to a flow-of-control instruction, we now say whether the branch
will be taken or not.
• The PowerPC disassembler is now POWER-clean, and a lot smaller.
• When disassembling PowerPC code that includes CFM exports, you'll no longer see
the name of each procedure twice in succession.
• Setting breakpoints should now be much more reliable. We now flush the appropriate
PowerPC hardware cache lines when inserting and removing breakpoints. We used to
be really stupid and flush the 68K cache, which didn't do anything useful.
• We can now handle all native exceptions with VM enabled (we used to crash in a
most spectacular way).
• You can now set breakpoints in code that is file-mapped.
PROCEDURE NAME DISPLAY
----------------------
When deciding if we should redisplay the name of the current procedure at the top
line of the PC window area, we used to fail if the PC was located at 2 GB or above
($7FFFFFFF+). The thing you'd most-likely notice about this problem was the “Will
branch/not branch” message would be drawn on top of the hex target branch address
when stepping.
MODERN MEMORY MANAGER HEAP STUFF
--------------------------------
Previous versions of MacsBug were confused by the format of the Process Manager
heap. If you'd “hx” to the heap, and then dump all relocatable and non-relocatable
blocks, it thought they were all corrupt.
When displaying the names of known heaps (System, Application, etc.), we now name
the ROM read-only zone and the Process Manager heap. One place you'll see this is
when you execute the “hz” command.
BREAKPOINTS
-----------
Due to the above heap problem, trying to set a breakpoint in a block that lived
in the Process Manager heap was a hit or miss proposition, and sometimes you'd
even get a bus error. Since MacsBug is no longer confused about the heap format,
breakpoints there should now work reliably.
A-TRAP TRACING
--------------
The A-Trap trace mechanism has been enhanced to allow selective filtering of trap
calls that get made at certain interrupt levels. When you're trying to find out why
a piece of code crashed and you want to see the calling path, you can now see calls
that are made with all interrupts enabled, for example. This can help filter out
lots of noise and get you closer to the problem faster.
When displaying each trap trace, the interrupt level at which the call was made is
now shown.
STACK CRAWL
-----------
No, I didn't do mixed-mode crawls yet. They'll be in the next release. I promise. What
I did do is make the “SC7” command work when you're in PowerPC code (it does a crawl
based on register r1). It does the job just as poorly as when in 68K code, but it's
still somewhat useful.
CFM SYMBOL LOOKUP
-----------------
We've sped up the process of lookup up CFM symbols quite a bit. The code that does
this used to be 68K, so we'd take a mixed-mode switch on each symbol that we iterated
over. The code is now native so we now take one switch on each lookup set, which is
a tremendous reduction. You'll most notice this when you evaluate the name of a CFM
symbol, such as “__NewPtr”. Native disassemblies may be a bit less jerky as well.
ROM INFO SYMBOL FILES
---------------------
When I introduced ROM symbol files in 6.5d10, I neglected to mention exactly where
your ROMInfo/ROM map file should be placed. No matter what kind of file you're using,
it must be located at the root level of your System folder.
When loading ROMInfo files that contain unparseable text, the state machine used to
identify the problem, but never did anything about it. It would then get stuck in
a loop, and eventually would bus error. The error handling code has been improved
quite a bit, and MacsBug now tells you near what character it ran into parse problems.
Any symbols that were read up to that point will have been recorded properly. In the
future, MacsBug will continue parsing until the end of the source file, in case there
are more symbols after the point that it errored.
FILL COMMAND
------------
We've added a new command, “FILL”, that allows you to fill large (or small) ranges
of memory with a repeating long value. The range must be long-aligned and the count
must be a multiple of four bytes.
FILE DCMD
---------
This dcmd now has a shorter display mode which skips showing all open font files.
To use this shortened format, invoke the dcmd with a file reference number of zero
(this is always a bad file reference number to the OS). The display looks much the
same, except font files are ignored and a count of the number that was skipped is
shown at the end of the list.
RD DCMD
-------
The RD dcmd also has a short-format display which ignores all open font files.
To use this new feature, invoke the dcmd with the new “-s” option.
When listing all maps in the current chain with either -s or -c, the output has been
made to align a bit better, and we've added a new field. For each open file, we now
show the map flags field right after the map handle.
For any resource map that is overriding the System file (such as the active enabler),
you'll now see a “+” in the leftmost column.
For any resource that has been purged, we draw a “*” symbol to the right of the
handle address.
GESTALT DCMD
------------
We now skip the 'eajt' selector (Easy Access), because the first time you look it up,
Easy Access tries to open a resource file to find the value, which hangs us. Hopefully
we'll have a more general solution for this in the future.
DCMD.H
------
The dcmd.h header file which is used to build dcmds in C now requires you to build with
at least the 2.0a3 Universal Headers because ExceptionInformation has been changed to
ExceptionInformationPowerPC.
BUILT-IN MACROS
---------------
The “StdLog” macro has been changed to use the shorter display options of the File and
RD dcmds. This leaves out mostly-useless information (open font files), and shortens
the bug log so that the chances are greater that it will fit in a bug report. The
display of the stack crawl has been moved to the end of the macro so that if we're on a
bad stack we'll get everything else logged before the stack crawl fails.
There's a new macro named “ropen” which sets A-Trap breaks on all traps that open
resource files. When a trap hits, the name of the file that was being opened is shown.
This macro is really useful when you're tracing the system boot process, or debugging
a 3rd-party application and would like to know what files get opened.
MACSBUG'S SELF CHECKSUM
-----------------------
In an effort to let you know when code has stomped upon MacsBug, it maintains a checksum
of its code space. Each time you enter MacsBug this checksum is re-evaluated and compared
to the original. If they differ, you will be alerted. However, due to some build changes
way back in 1993, approximately 17K of the most critical part of MacsBug was being left
out. This has been fixed.
MISCELLANEOUS
-------------
When you use the “WH” (“Where”) command to classify an address, MacsBug now does a better
job telling you if the address is in not in RAM or ROM.
Fixed the 8-bit low-level character blitter to not trash register A2. I said I did
this in 6.5d9, but it was actually trashing it in two different places. This could
cause problems with dcmds that use the drawing callbacks and expect A2 to be properly
preserved.
Made MacsBug work on the Mac Plus, SE, Portable and PowerBook 100 again. Our ROM family
check was changed in 6.5d10 to better work a future OS, and it broke really old machines
by making us think they were Mac II-class with Color QuickDraw. I don't think so.
Fixed the Log command so that it fails if you don't specify a file name when using the
“-h” option.
Fixed ATSS to make the “addr” parameter required. It was never optional, but the command
handler never enforced it.
Corrected some mistakes in the 6.5d10 release notes. Please see change bars (“|” in the
leftmost column) for deltas.
BUILT-IN DEBUGGER PREFS
-----------------------
Changes were made to various resources within the default debugger prefs which
is part of the MacsBug file itself. They include:
• Trap AA54 has a name, so it's now listed as TextServicesDispatch.
• 6.5d10 - Released 12/16/94
MULTIPLE DEBUGGER PREFS FILES
-----------------------------
We now support up to 32 debugger preferences files that can be named whatever you wish.
MacsBug looks in a folder named “MacsBug Preferences” which must be located in the root
of the System folder (in the future it may support the Preferences folder if there is a
call for it). Selector trap names, macros, templates, and dcmds can be located in these
files. Resources of type 'mxpr' (MacsBug prefs), 'mxbi' (MacsBug init), and 'mxbc'
(MacsBug colors) must still be located in your "Debugger Prefs" file, which cannot be
located in this new folder. If you place more than 32 files in this folder, MacsBug will
only load resources from the first 32 and will warn you about this.
BUILT-IN DEBUGGER PREFS
-----------------------
Changes were made to various resources within the default debugger prefs which
is part of the MacsBug file itself. It includes:
• Added some missing selectors off of ScriptUtil and SoundDispatch
• Fixed the AUXDispatch selector length so we actually disassemble these
• Made the Gestalt dcmd part of the standard build
• Added a template for the dcmdParmBlock (describes format 3 parm block)
PERFORMANCE SPEEDUPS
--------------------
MacsBug no longer flushes the entire processor cache(s) when entering and exiting. Any
time we have need to maintain cache coherency (such as when we set a breakpoint in RAM),
we do a local flush of the page(s) that contain the target addresses. With this change
and the accidental flush bug fix described below, MacsBug should no longer be causing
cache-related bugs to disappear when stepping, tracing, or handling A-trap actions. This
should also contribute to an overall speedier feel on '040 CPUs.
I fixed a really nasty typo in the procedure that sets MacsBug's A5 world as current.
Someone rewrote it a while back (1991) and left the old code commented out in
place. However, they commented out the procedure's RTS instruction as well. Unluckily,
the code that we fell into was MacsBug's internal FlushCache routine which took no
parameters, so we didn't crash (which would have forced someone to notice this
a long time ago). By making this routine not fall into the flush code we've sped
up a bunch of things to the point of being much less annoying to use. Things that
are affected, in order of most visible to least:
• Any time we use trace exceptions to enter (most-noticeable for Step Spy)
To show myself how much faster this now is, I did some timings when
booting my main MacsBug machine, a PowerBook Duo 280c. The results are
quite impressive and show over a 5X speedup for this particular case.
The test was to Step Spy a longword-aligned long location (this is handled
as a fast special-case inside MacsBug) which would not change. Timings are
in seconds from the time the first 'INIT' resource in the first extension
was to be loaded to the time that the Process Manager is first executed.
16s - Normal boot with MacsBug 6.5d10 installed but not activated in any way.
71s - Step Spy enabled on 0x00000924 with MacsBug 6.5d10 (without flush bug).
376s - Step Spy enabled on 0x00000924 with MacsBug 6.5d9 (with flush bug).
• When any A-Trap action of any sort (ATT, ATR, ATB, etc.) is pending
• When we handle any PowerPC exception (includes stepping and tracing)
• Within our SetTrapAddress skank-o-matic patch
• Dcmds that walk the heap via the callback no longer flush on each block walked
• Any callback a dcmd makes
• Any time a dcmd is called to perform any action
• Entering MacsBug via an NMI or any user-visible exception
• When we handle a bus error (visible to user) while in MacsBug
• When we do an ES or EA
MacsBug is a bit faster when swapping or scrolling the screen on PowerPC machines.
We used to use BlockMove to do this, but internally it uses the 'dcbz' instruction
which causes an alignment exception when writing to non-cacheable space (like the
screen). We now use a function that is functionally equivalent to BlockMove, but that
does not use 'dcbz'.
ROM MAP/ROM INFO SYMBOL FILES
-----------------------------
We now support ROM map (old style) and ROMInfo (new-style) symbol files. Thanks to
Cameron Esfahani for this way cool code (You da' man!). This means that during disassembly
of ROM code you will see symbols for internal ROM routines, rather than just trap names.
If in any expression a local symbol in your code collides with a ROM symbol, but you want
to force the evaluation to match the ROM first, prefix the symbol name with the '®'
(option-R) character.
MacsBug currently looks for files of specific names for each machine. The name is chosen
from the Gestalt 'mach' selector for the current machine. If a file name for your machine
isn't found in MacsBug’s list, it tries to load a file named “ROMMap”. The list of
supported files and the corresponding machine ID is:
"MacPlusROM.map", // 4
"MacSEROM.map", // 5
"MacIIROM.map", // 6
"MacIIxROM.map", // 7
"MacIIcxROM.map", // 8
"MacSE030ROM.map", // 9
"MacPortableROM.map", // 10
"MacIIciROM.map", // 11
"MacIIfxROM.map", // 13
"MacClassicROM.map", // 17
"MacIIsiROM.map", // 18
"MacLCROM.map", // 19
"MacQuadra900ROM.map", // 20
"MacPowerBook170ROM.map", // 21
"MacQuadra700ROM.map", // 22
"MacClassicIIROM.map", // 23
"MacPowerBook100ROM.map", // 24
"MacPowerBook140ROM.map", // 25
"MacQuadra950ROM.map", // 26
"MacLCIIIROM.map", // 27
"MacPowerBookDuo210ROM.map", // 29
"MacCentris650ROM.map", // 30
"MacPowerBookDuo230ROM.map", // 32
"MacPowerBook180ROM.map", // 33
"MacPowerBook160ROM.map", // 34
"MacQuadra800ROM.map", // 35
"MacQuadra650ROM.map", // 36
"MacLCIIROM.map", // 37
"MacPowerBookDuo250ROM.map", // 38
"MacIIViROM.map", // 44
"MacPerforma600ROM.map", // 45
"MacIIVxROM.map", // 48
"MacColorClassicROM.map", // 49
"MacPowerBook165cROM.map", // 50
"MacCentris610ROM.map", // 52
"MacQuadra610ROM.map", // 53
"MacPowerBook145ROM.map", // 54
"MacLC520ROM.map", // 56
"MacQuadra660AVROM.map", // 60
"MacPerforma46xROM.map", // 62
"MacPowerBook180cROM.map", // 71
"MacPowerBookDuo270cROM.map", // 77
"MacQuadra840AVROM.map", // 78
"MacPerforma550ROM.map", // 80
"MacPowerBook165ROM.map", // 84
"MacLC475ROM.map", // 89
"MacQuadra605ROM.map", // 94
"MacPowerBookDuo280ROM.map", // 102
"MacPowerBookDuo280cROM.map" // 103
If, using the two above tries, MacsBug fails to load any map file, it tries to load the
new-style “ROMInfo” file. For this style of file there presently is no machine name to
machine ID mapping, since there is no officially maintained ROMInfo file collection as
there is with the ROM map files (they are packaged with MPW on the E.T.O. developer CDs).
DCMD CHANGES
------------
We now support a new style of dcmd, format 3. Most of the changes are designed to make it
easier to add functionality to the dcmd callback and action interfaces in the future.
Format 3 dcmds will not load on versions of MacsBug prior to 6.5d10.
To build a format 3 dcmd, the BuildDcmd tool has been enhanced to take a format specifier
option. If the '-format3' option is passed, the tool generates the new style dcmd. If no
option is specified, the older style format 2 dcmd is generated. The only physical
difference in the two formats is the embedded version word. All other differences are in
the programming model MacsBug provides, and the requirements MacsBug makes on the dcmd.
New dcmds are required to ignore action requests that they do not handle or recognize.
This means that they must not display any sort of error if given an undefined action
(no beeping!).
The DcmdParmBlk structure has been extended with the MacsBug version, maximum supported
callback number, current ISA, PowerPC exception structure pointer, and general-purpose
I/O buffer pointer.
The 68K RegisterPtr and PowerPC exception structures will only be valid if the respective
pointers are non-nil. At present the structures will only be valid when the corresponding
ISA is the current ISA. For example, if the current ISA is kM68KISA, then the 68K register
set will be valid and the PowerPC information will not be valid. This may change in the
future such that both register sets may be valid at the same time, so check for non-nilness
rather than the associated ISA.
Added a new action code, dcmdGetInfo, which returns dcmd version, usage string, and
credits string. For format 3 dcmds this means that when given the dcmdHelp message, a
dcmd should only draw the body of the text and no headers or usage information. MacsBug
uses a combination of the dcmdGetInfo and dcmdHelp messages to display a more uniform
help and usage.
Added a new action call dcmdSecondaryInit which is called at a time when all System
patches have been loaded (including native code on PowerPC), but is immediately before
extension/INIT loading. This may only be guaranteed with 7.1, (7.1.1), 7.1.2, and 7.5.
This is a good time to apply persistent global toolbox patches or record various state
information before extensions or the Process Manager have a chance to muck things up.
Added a new action call, dcmdShutdown, which is presently not used. It'll be more defined
in a future release.
POWERPC DEBUGGING
-----------------
WARNING: The native disassembler included in this version is not POWER clean. It will
execute illegal PowerPC instructions when disassembling a variety of opcodes
on a 603 or 604 machine. This will be resolved by the next build.
PowerPC debugging is enabled for the first time. With this build the support is
quite rudimentary, however. A few new commands were added to support the PowerPC
feature set. They are:
ILP - Disassembles PowerPC instructions from a given address.
IPP - Disassembles a half-page of PowerPC instructions centered on the given address.
IDP - Disassembles 1 line of PowerPC instructions.
DHP - Disassembles a sequence of 32-bit expressions as PowerPC instructions.
GP - Propagates the PowerPC exception we last handled to the next exception handler
registered with the system.
BRP - Sets a breakpoint in PowerPC code (does not currently support breakpoints in ROM).
The behavior of some commands have been enhanced to support PowerPC debugging. The
changes that have been made thus far are:
TD - When in PowerPC code, this displays the entire PowerPC register set.
IL - When the current ISA is PowerPC, typing IL without an address (which implies the
current PC), MacsBug will automatically disassemble the code as PowerPC.
IP - When the current ISA is PowerPC, typing IP without an address (which implies the
current PC), MacsBug will automatically disassemble the code as PowerPC.
WH - If the address being examined is located within a CFM container, MacsBug will
display the name of the fragment, along with the nearest exported symbol.
MacsBug now understands all native PowerPC exception types when they occur, and will
activate with the display formatted for debugging PowerPC code. For example, if native
code causes a bus error, MacsBug will gain control and break into the code at the
address of the faulting code, just like it does for 68K code. From there you can step,
display and change registers, use dcmds, etc. Be aware that stepping and tracing in this
release is extremely limited. You can only step one instruction at a time, and cannot
step over any branch instructions (you'll always step into the branch call). Full PowerPC
debugging will be available in a future release.
| There currently isn't any way to step over Mixed Mode transitions from one ISA to another -
you'll need to set a breakpoint on the other side of the transition and go until it is
| hit. In the future MacsBug will be intelligent about this, and debugging the two instruction
sets will be seamless.
SYMBOL LOOKUP
-------------
We now use the Code Fragment Manager to look up symbols when running on PowerPC machines.
Many commands benefit from this, including but not limited to WH, DM, ILP, and DHP.
SELECTOR-BASED TRAP NAMES
-------------------------
The ATP command now displays actual selector names of calls that were made, as well as
| the parent trap. The parent trap name is shown in parenthesis.
LOGGING
-------
Log files are now created by default on the root of the boot volume. The Log command now
has a parameter, '-h'. This allows you to save your scrollback history from the beginning
to the bottom of the current screen (if you've scrolled up into the history when you
execute this, all lines off of the bottom of the screen will be lost, as with any other
command). Thanks to Hoon Im for taking some time out to add these cool features way back
for 6.5d9, but we forgot to tell you about them.
| Note that the log file will remain open. You must execute the “log” command with no parameters
| to close the file.
RESTART/REBOOT COMMANDS
-----------------------
RS and RB commands should now work on the Mac Plus, and more importantly, they should once
again work on all future machines. Both of these commands now use the Shutdown Manager
(ShutDwnStart) if it is deemed necessary. However, they will not run any items that have
been queued with ShutDwnInstall on the premise that your machine is probably already hosed
and running a high-level shutdown proc probably wouldn't be a good idea at this point.
PCI BUS DISPLAY SUPPORT
-----------------------
The video initialization and control code was rewritten to support the new PCI machines.
Since these machines no longer have NuBus-style declaration ROMs, we now use new video
driver calls to obtain information we previously used the Slot Manager for (getting base
addresses, bit depths, etc.). If the new calls fail (as they will on non-PCI machines at
present), we drop back to using the Slot Manager.
MEMORY USAGE AND ERROR REPORTING
--------------------------------
Throughout MacsBug's initialization code, we now follow the boot code rules in regards to
how much memory can be allocated from BufPtr. If we cannot at least get our stack and
video buffer, we will refuse to load. If we can't load other non critical resources and
preferences, we'll load, but we'll show a message indicating a memory allocation problem
when you first enter the debugger.
If MacsBug refuses to load, for whatever reason, it will display an error message
in place of the “Debugger loaded” message on the “Welcome to Macintosh” startup
screen.
MacsBug's internal stack is now always 10K in size, which is up from 4K. This was added
to stop some stack overflows we were seeing with the new PowerPC features. However, this
will benefit dcmds as well since they normally use MacsBug's stack.
MISCELLANEOUS
-------------
The HOW command can now display the name of the currently loading extension in the same
manner that is automatically done when you enter MacsBug at boot time. This is useful for
bug log reports since this command is already part of the StdLog macro.
When dumping the MMU state on an '030 or '851, the "PSR" register is no longer incorrectly
called "SR".
• 6.5d9 - TOTALLY NEW STUFF
-----------------
Added the DMA command (dump memory in ASCII). The syntax is just like DM.
Added .S suffix ("strip"). For example, PC.S is the same as PC if you are
in 32-bit MMU mode, or (PC & 0x00FFFFFF) if you are in 24-bit MMU mode.
MacsBug actually calls the StripAddress trap to implement this.
ENHANCEMENTS
------------
When you break into MacsBug at boot time by holding down the Control key, now
it shows a more enlightening message. Hopefully this will stop people from
writing up bugs that say "I rebooted with the control key held down, and I got
a User Break!"
When you break into MacsBug during boot, it displays the name of the currently-
loading extension, if any.
Command lines consisting only of "G", "T", or "S" do not appear in the command
line history (Command-V / Command-B). The side-effect is that Command-G, -S,
and -T do not enter anything into the command line history.
The SET command now displays its syntax if you tell it something stupid.
"HZ" shows "Mod" for Modern Memory Manager heaps (it used to say "Fig").
The "WH" command, and others, can determine that an address is "inside MacsBug".
The "DV" command includes some credits. "dv v" shows just the version, with
no credits. MacsBug gets its version from its 'vers' 1 resource.
The CurApName display uses an ellipsis character to truncate long names, rather
than an underscore.
Added an 8-bit-deep blitter (speeds up display on video cards that cannot switch
to 1-bit mode). Made the one-bit blitter faster, too. Made scrolling up and
down faster for all bit depths.
MACROS
------
Changed the maximum command line length to 250 (was around 90 before). So now you
can have very long macro expansions.
Added a macro called "StdLog" (standard log), which is great for writing up bug
reports. It creates a log file full of info that system software engineers like
(stack crawls, register dump, configuration info, etc).
Lots of random cleanups of the macros. Removed redundant macros.
Changed "da" and "dd" macros to "DApp" and "DDrvr", because "da" and "dd" are valid
hex numbers.
DISASSEMBLY
-----------
Trap vector names now show up in disassembly (and elsewhere) just as if you had a
macro mapping into every address in the trap dispatch table. For example,
MOVEA.L $06F4,A0 now disassembles as MOVEA.L jCacheFlush,A0. The trap is vCacheFlush,
but the "v" (for vector) gets automatically changed to a "j" (for jump).
The forms JSR ([$xxxx]) and JSR ([$xxxx],$yyyy) now support macro-style symbols for
the $xxxx values.
(Of course, do NOT use trap-table addresses in application code, but when you come
across the system doing so, it's much easier to see what's going on now.)
Fixed bugs in selector comparison (it was not always sign extending correctly).
Disassembly now recognizes a CLR.W before a trap word as setting up selector with
value zero.
The PC disassembly window refreshes when you change D0-D7, A0-A7, SR, or PC. It
was only refreshing on PC changes, but the others also affect the disassembly,
because of symbolic info on JSR (Ax), "will branch" messages, and "will loop" (DBxx)
messages.
TRAP NAMES
----------
Generally brought tons of traps and selectors up to date and made them better.
Updated PowerMgrDispatch stuff to match WWDC 94 Technology CD document. However,
MacsBug can't handle the different variants of OS-range traps having different names
and different selectors, so the $A085 trap disassembles strangely. The $A685
(PowerMgrDispatch) stuff is all there, but it (incorrectly) shows up for all variants
($A085, $A285, $A485, as well as $A685).
DCMDS
-----
Several commands now draw bullet characters in place of all control characters in
strings (affects 'file' showing Return characters in filenames, for example).
Gestalt command dumps all Gestalt selectors. Supports System 7.5 Gestalt table format
as well as older versions.
The 'rd' command now shows an asterisk after any handle that has been purged. It also
accepts capital letters for the options.
BUG FIXES
---------
Fixed some random memory accesses that were happening on non-Color QuickDraw machines
during MacsBug startup. This was causing the mouse to freeze in one or two directions
on a Mac Plus.
Fixed trashing of D3 and A2 in BlitCharOneBit and BlitCharEightBits.
Changed PBControlSync to PBStatusSync because we were trying to do a cscGetMode
instead of a cscSetMode. (Affects compatibility with certain video drivers.)
• 6.5d8 TOTALLY NEW STUFF
-----------------
Over the last few releases, we've worked to make MacsBug a bit more user-
configurable and customizable. However, these configuration options have
thus far been limited to setting bits in a preference resource, which
doesn't allow for many on-the-fly changes. We've added a new general-purpose
command that will enable behaviour changes any time you wish. The new command,
SET, will be able to take a variety of options. The first is the new
"ScrollPrompt" feature. By entering a command such as, "SET SCROLLPROMPT OFF",
MacsBug can be told to never wait for a key if a new page of the scrollback
history has become filled. Other variants of the new command are shown in
the built-in help. In the future you'll find lots of other cool things you'll
be able to do.
There's now a 512-byte scratch memory area within MacsBug that's available for
whatever you like. It's called "PlayMem" (TMON user's will recognize this), and
can be used within any expression. The constant will evaluate to the address of
the beginning of the buffer area.
A-TRAP DISASSEMBLY
------------------
Removed bogus duplicate A-trap name for StdOpcodeProc (it's really $ABF8;
it was also in the table as $ABC8).
Fixed vFileReal to be vFileRead.
Unused/unknown A-traps now disassemble as "DC.W $Axyz" instead of "TB z" or "OS z".
Lots of new names have been added to previously existing selectors, but they are
too numerous to go into here.
All calls have been updated to the more verbose new Inside Macintosh naming
conventions. All old versions still work through the magic of macros.
Disassembling selector-based calls is now much smarter when it comes to identifying
the correct call. When it looks back up the code stream to identify the selector
value, it is more knowledgeable about the various MOVE immediate instructions.
It no longer unhelpfully interprets random data as selector values.
A-TRAP TRACING
--------------
It now correctly works again (no more _Open calls). It'll be more verbose in the
future, but at least it now does what it did before.
A-TRAP RECORDING
----------------
Versions of MacsBug from 6.4 through 6.5d6 had a serious bug that appeared
during A-Trap recording. When recording OS calls, we save the first 8 bytes
pointed to by register A0, for display by the 'ATP' command. In the
instances that A0 isn't an input parameter to the trap, and contains an
invalid pointer (outside of valid memory on the target machine), MacsBug
takes the precaution of installing a special bus error handler when it
attempts to copy the data. However, previous versions improperly installed
the handler (they hooked on top of two vectors, both of which were wrong).
Thus, if a bus error occurred during the copy, MacsBug's primary handler
would take control and display the error to the user, which was completely
the wrong thing to do.
HEAP DUMPS
----------
When MacsBug dumps heaps that contain resources from open files, it is more
careful in showing the error, "** bad rsrc map**".
SCROLLBACK HISTORY
------------------
The supported sizes of the scrollback history buffer have been changed to
allow for a much larger buffer. Previously, only values of 0-32767 were
supported, which specified the requested history buffer size in bytes. 0
and 1-255 indicated that no history buffer should be allocated at all. Now
values of 32768-65535 are valid, and 1-255 indicate special larger sizes.
For 1-255, the value is multiplied by 64K, giving a range of 64K-16MB in
64K increments. Zero is still supported to allocate no buffer.
(Page Up/Down mostly work, but there are still a few problems.)
SYMBOL LOOKUP
-------------
If we break into MacsBug with VM enabled and paging isn't safe, we now act
as though symbol display is turned off (via the "SX" command). Doing symbol
lookups causes heaps throughout memory to be walked, possibly causing quite
a bit of paging to take place. This is an extremely evil thing for a low-level
debugger to do, and we're trying to be as nice as we possibly can.
COMMAND-: SYMBOL LOOKUP
-----------------------
Fixed the infamous C++ unmangled symbols problem. MacsBug would show you the
symbol in the Command-: window, but it wouldn't evaluate it unless you stripped
the quotes from the unmangled name. This is no longer necessary.
If you hold down the Option key when pressing return after selecting a symbol,
the address of the symbol is entered onto the command line, rather than the
symbol itself. However, if you navigate the list by typing and use this feature,
it used to dump a semi-random address. This has been fixed.
MEMORY DISPLAY
--------------
When displaying addresses that correspond to bus error vectors (0x00000008
through 0x0000000B and VBR+0x00000008 through VBR+0x0000000B), we now show the
previous vector addresses, not the MacsBug handlers. This should make it a bit
easier to find your code if you replace either bus error vector.
The built-in font now contains the entire high-ASCII character set for a more
useful display ($20 through $D9). You can now type all of these characters as
well.
Template related code has been fixed to not cause address errors on 68000
machines.
STACK CRAWL
-----------
When determining if a given address is really a return address as we walk up
the stack, we no longer cause page faults. This should make the stack crawl
commands a bit more useful when used in an environment where VM paging is not
safe.
BREAKPOINTS
-----------
If you set or clear a breakpoint, the disassembly display area above the command
line will be redrawn, in case there's an upcoming break that's already been called
out with a bullet alongside an address.
REGISTERS
---------
Code dealing with setting and displaying the Status Register now realizes it is
16-bits in length and always has been. This bug has been present since at least
6.2.
LOGGING
-------
If you attempt to turn the log on or off when the file system is busy, MacsBug
will warn you that this is impossible. This helps a bit in preventing data on
your drives from being corrupted, but there's still a huge architectural flaw
in the whole thing (ask me about my 400 MB I had to restore from tape...). In a
nutshell, it works, but just barely.
MISCELLANEOUS
-------------
Keyboard repeat rates have been fixed for the Mac Plus (it no longer spews tens of
keys for each individual keypress).
DCMDS
-----
RD - The help explains what the various attributes flags are. Map $0003 shows up
with a special name now, instead of garbage (it makes ROM resources override the
system). The command aborts much faster now if you press a key. Fixed problems of
excess filtering when you used -f along with -t or -i (or when you used -i at all).
• 6.5d7 - NOTE: This version sorta-kinda exists. It was released to a small number of
individuals related to the System 7.5 and PowerPC v0 teams, but it was never
generally released. There are actually a few different versions of d7, so it was
decided the best thing to do was say, "don't use it - use 6.5d8 instead".
• 6.5d6 - HEAP SCRAMBLING
---------------
It works again, what more can I say? Starting with MacsBug 6.5d1 (before I
took over the project), the Heap Scramble command was broken for all Memory
Managers, including 24-bit, 32-bit, and Modern. It now works properly for
the classic Memory Managers, and for the first time, is works equally well
for Modern-style blocks and heaps.
If you break into MacsBug because of a Heap Scramble failure, the proper
tool name will be displayed. It used to try to display the names of
selector-based tools, but failed, since we only scramble on a few real
A-Traps. All you would see is a bunch of gunk, but no harm was done.
EXCEPTION HANDLER
-----------------
While you're sitting at the command line, MacsBug has its own bus error
handler installed. If something goes wrong, you'll generally see the
message "Unable to access that address". However, if the exception was
generated by code within MacsBug, finding the code that actually caused
the exception was quite difficult. Now MacsBug displays some simple
diagnostic information, including the Program Counter of the code that
really caused the exception.
• 6.5d5 - With the addition of "User Debugger Prefs" there's been a lot of confusion.
So, in an effort to reduce this, and make absolutely sure each version of
MacsBug has available the resources it needs to run, "User Debugger Prefs"
is no longer supported, and the Debugger Prefs resources now exist within
MacsBug itself (that's why it's now almost 400K on disk). All custom
resources should go into Debugger Prefs, and MacsBug's resources should be
left alone.
- We now check for duplicate dcmds at startup and display their names.
You'll see this list (if you have any duplicates) the first time you enter
MacsBug.
- Increased the number of words that DH can disassemble at once from 6 to 18.
- Fixed a minor bug with A-Trap actions. If you had an action set on any
selector, removed it, and then did an 'ATSS', 'ATB', or 'ATHC' with no
parameters, the range start would appear to be the old selector. We were
setting the selector flag and value fields in the trap record if the
selector was specifically described, and we weren't clearing them
otherwise. Since the new action record was in the location of the old
record, the uninitialized fields were used.
- When an A-Trap Trace is displayed, we now show the name of the selector
instead of its parent A-Trap, if necessary. This means if you do an 'ATT'
on _GetFrontProcess, for instance, when the trace information is dumped
into the MacsBug history, the trap name will be _GetFrontProcess instead
of its parent, _OSDispatch.
- When you break into MacsBug because of an A-Trap action on a selector-
based call, the selector name will be displayed instead of the parent
A-Trap name.
- We now mostly work on 68000 machines (again). If the trap name STR#
resources were an odd length, we'd address error at startup while trying to
load them. We now pad them in memory to be word-aligned, just like all of
our other structures (would you belive I solved this one with MicroBug?)
- Updated the TestDcmd application:
-Made the font draw like they do Macsbug (you get space through ~, plus
≈ and † and … and •, and everything else is a bullet).
-Made Command-G = Command-Q.
-Made ? = help.
-When the screen is paused, still proccess events except for non-Command
keypresses.
-Made space continue as well as return/enter.
-Made Clear/Ctrl-X clear the command line.
- In the 'file' dcmd, made some columns wider and fixed the filename-prefix
feature.
- In the 'drvr' dcmd, widened the driver name field so you can see longer
names without truncation.
• 6.5d4 - Fixed command line history to not get confused when you repeat a previous
command with Command-V or Command-B. It wasn't resetting the history marker
when you entered a new command that exactly matched the last command, so you
could only repeat the last command once, and then the last command would
become the line prior to that.
- Fixed a nasty bug dealing with most break action commands. If you set more
than one A-Trap break, A-Trap Step Spy, or Breakpoint, each new break
would overwrite the previous, corrupting it. The record that could become
the most damaged was that of the Step Spy, which could cause MacsBug to
become way confused the next time it walked the table. Almost not broken
just isn't good enough for me!
- Breaking on selector-based calls now works! If you want to break on one of
these calls, ATB (and all of its variants) now use the same structures
that provided for the disassembly of selector-based calls. I've slightly
modifed the displays for the ATB and ATD commands to account for the fact
that you're not necessarially breaking on all calls of a specific ATrap.
It now shows you both the selector name and ATrap name, plus the ATrap
and selector values.
The way that this works is cool enough that you can still provide a
conditional break expression which allows for even more fine-tuning of
when to break. So something like, "ATB _GetFrontProcess D0.w=-1" will
work, even though in most cases it's not really that useful, since in this
case it's already implicitly breaking on the expression "(SP)^.w=39".
If there are calls that you can't seem to break on, there are a number of
reasons why. The most-likely is that I simply haven't yet added calls of
that particular A-Trap to the prefs file (although it could be there and
I simply screwed up the selector).
- Because of the above, I've removed lots of redundant macros from the
Debugger Prefs file (the ones that did the "ATB _CallName d0.w=#x").
- MacsBug now supports a new preference resource (which can be located in
either the User or standard Debugger Prefs file) of type 'mxpr'. Its
sole purpose in life right now is to support some cool power-user
"danger prefs" that support doing things a bit faster. There's a ResEdit
TMPL provided in Debugger Prefs which allows you to edit the various
defined bits. I recommend copying it into your User Debugger Prefs file
(since that's why I added the file anyway) and changing it there.
I'll probably eventually add new commands to MacsBug itself that let you
modify the more useful preferences at run-time.
- Two preferences bits support disabling the little-known self-checksum
feature. Normally, after you execute any command from the command-line,
MacsBug performs a checksum on all of its code, and warns you if it was
modified. While this can be quite useful, most will never see the message.
The annoying bit is that this takes a heck of a lot of time (MacsBug's
code is about 100K in memory right now, so on my analyzer-bait Mac II the
checksum takes 151.1ms).
Now you can selectively disable the checksum in all cases by setting the
"Never checksum MacsBug code" bit. If you'd like some assurances that
MacsBug wasn't stomped on, you can set the "Only checksum code on entry"
bit. When you enter MacsBug, either through a DebugStr or Debugger trap
or via an NMI, it will perform the checksum. Note that the "never" bit
overrides the setting of this bit.
- One other bit has quite a noticeable effect on stepping and tracing with
a machine that has a single monitor (or one that has MacsBug on its main
device). This bit, "Don't swap screen if stepping", does just what it
says. If you step with this bit set, MacsBug will never swap the display
to show the original video buffer. This is slightly dangerous if you're
stepping code that does draw directly to the screen (because the video
card could have been in an entirely different mode than what it is when
you're in MacsBug). However, it will have no effect if you trace over a
QuickDraw trap, because the display _will_ be swapped in that case. Use
this, it's waaaaay cool. And faster too.
- Added macros for GSBug users (me) who just can't seem to type the right
commands while in MacsBug. STB now works for ATB, CTB now works for ATC,
and SH works for ATD (actually, these were added in 6.5d2, but I neglected
to mention it then).
- Twiddled the message for MCC when a macro is cleared. It now says,
"Macro '<macroname>' cleared" instead of "'<macroname>' cleared.
Dave freaked for a second when he typed "MCC heap", and MacsBug responded
with "Heap cleared". :-)
- Modified the 'vbl' dcmd to use uppercase in hex displays (we're picky
people). It now dumps all of the non-empty slot VBL queues in addition to
the standard queue.
• 6.5d3 - Modified to load selector traps, macros, templates, and DCMDs from two files.
We still load from Debugger Prefs, however, we now support a new file, "User
Debugger Prefs". This allows you to paste all of your custom resources into
the User file, and not worry about having to copy resources when you upgrade
the standard DP file. We also now allow 'mxbi', 'mxbc' and 'KCHR' resources
to be found in the User file to override the default ones we ship in the DP file.
This change causes all of the above mentioned resources to be loaded in
the opposite order that they were in previous versions (all types of
resources are now loaded increasing from index 1).
- The Clear key and Control-X now clear the entire command line and move the
cursor to the left edge.
- The key delay to repeat and repeat rate have been (hopefully) equalized
for all machines. No more annoying slowness on fast machines.
- Sped up the one-bit single character blitter to be as fast as it was in
6.2.2. The overall string drawing throughput is slower than 6.2.2, but
it'll probably get faster in later versions. As compared to 6.5d2, however,
the blitter is 6.3 times faster, which is quite cool.
• 6.5d2 - Added a new resource type, 'mxst', to Debugger Prefs for the display of
toolcall names that are selector-based (ie. HFSDispatch). This allows you
to see the names of the real calls, rather than simply the dispatch trap name.
Eventually you'll be able to break on the names, instead of having to define
macros like you do now. I added a bunch of toolcall names to Debugger Prefs,
but there are certainly some missing, and there may be some that are incorrect.
• 6.5d1 - Moved toolbox and OS trapnames into STR# resources in the Debugger Prefs
file. Added initial support for the Modern Memory Manager.
• 6.4a9 - Fix breakpoints in ROM to actually break.
- Fix to not mess with the interupt levels if we enter MacsBug in user mode.
• 6.4a8 - Fix problem with the calculation of video slot address causing some
machines to not boot.
- Remove indication of bit depth from MacsBug screen. This bit depth was
indicating what the depth MacsBug was operating in not the depth of the
monitor when running normally.
• 6.4a7 - Support for multibit video.